DarkOneVenzar
|
Diviner
|
|
|
Reged: 11/04/03
|
Posts: 2774
|
Loc: Realm of Darkness
|
|
|
Ok I tried getting what I need from the MWSFD 8.0 but I failed. So this is what I am kindly asking for:
A script so that when the player picks up one of my new items the door to the room locks and a creature is spawned, it will be a custom creature. Then when the creature is killed the door opens, I do not want it to be lockpickable, the door I mean.
So can someone please help me out with this?
-------------------- 7-Zip Forever!
Home of the 8-bit theater
Intellectua- Join today
Post Extras:
|
|
|
The door needs to have a unique ID, lets call it "door_01". The creature needs to be from the creature lists, not the levelled lists, lstes say you make a unique creature "golden_saint_01".
On the item put this untested script
Code:
Begin PB_Summon_lock
short dead short done
if ( OnActivate == 1 ) if ( done == 0 ) door_01->lock 100 PlaceatPC "golden_saint_01", 1, 250, 1 set done to 1 Activate else Activate endif endif
if ( dead == 0 ) if ( "golden_saint_01"->GetHealth < 1 ) door_01->unlock Set dead to 1 endif endif
end
Post Extras:
|
DarkOneVenzar
|
Diviner
|
|
|
Reged: 11/04/03
|
Posts: 2774
|
Loc: Realm of Darkness
|
|
|
Does that amke the door impossible to lockpick? Because I do not want some sneaky theif type to just unlock it and walk out. I want them to have to figh tthe creature that gets spawned.
-------------------- 7-Zip Forever!
Home of the 8-bit theater
Intellectua- Join today
Post Extras:
|
|
|
Quote:
Does that amke the door impossible to lockpick? Because I do not want some sneaky theif type to just unlock it and walk out. I want them to have to figh tthe creature that gets spawned.
Ok, easy enough
On the door, put this untested script
Code:
Begin PB_unpickable
if ( Onactivate == 1 ) if ( GetDeadCount "golden_Saint_01" < 1 ) Messagebox "The door remains magically sealed" "OK" Playsound3d "lockeddoor" else Activate endif endif
end
This way, your sneaky thief wont discover he cant get out intil he has picked the door
Post Extras:
|
DarkOneVenzar
|
Diviner
|
|
|
Reged: 11/04/03
|
Posts: 2774
|
Loc: Realm of Darkness
|
|
|
Ok that script I put on the door doesn't even let the player get into the room. Is there a way to get it started after the one on th eitem is activated? Or another possible way?
-------------------- 7-Zip Forever!
Home of the 8-bit theater
Intellectua- Join today
Post Extras:
|
TheSlof
|
Curate
|
|
|
Reged: 03/16/04
|
Posts: 425
|
Loc: Trollhättan, Sweden
|
|
|
You could do this with a Global.. Or put the door-script as a part of the OnActivate-script for the item..
eg.
Code:
begin lockthedoor
short state
if ( state == 0 )
if ( OnActivate == 1 )
PlaceatPC "golden_saint_01", 1, 250, 1
set state to 1
endif
endif
if ( door_id->OnActivate == 1 )
if ( state == 0 )
Activate
elseif ( state == 1 )
Messagebox "The door remains magically sealed" "OK"
Playsound3d "lockeddoor"
if ( state == 2 )
Activate
endif
endif
if ( state == 1 )
if ( GetDeadCount "golden_Saint_01" < 1 )
set state to 2
endif
endif
I think this should work...
-------------------- My tutorials:
Here or here!
||||||
Post Extras:
|
|
|
Quote:
Ok that script I put on the door doesn't even let the player get into the room. Is there a way to get it started after the one on th eitem is activated? Or another possible way?
Apologies for that, I forgot that the creature wouldnt be dead yet before you enter.
Either do what the Slof suggests above or insert into the item script, in the OnActivate block in the same part where the door->lock comand is.....
set door_01.state to 1
Then, alter the door script
short state
if ( OnActivate == 1 ) if ( state == 0 ) Activate elseif ( state == 1 ) if ( GetDeadCount "Golden_Saint_01" < 1 ) Messagebox "this door etc etc" "OK" Playsound3d "lockeddoor" elseif ( getDeadCount "golden_saint_01" > 0 ) Activate endif endif endif
end
This way, the item script updates the variable 'state' on the door whe it is activated. until the item is activated, the door behaves normally, but once the item has been activated, the golden saint or whatever must be dead before the door can be activated again.
Hope that helps
Post Extras:
|
DarkOneVenzar
|
Diviner
|
|
|
Reged: 11/04/03
|
Posts: 2774
|
Loc: Realm of Darkness
|
|
|
Ok I have the scripts working right but now I have this problem. So if anyone knows how to fix it up let me know since I need it to work right. I have tried many things but no to avail.
-------------------- 7-Zip Forever!
Home of the 8-bit theater
Intellectua- Join today
Post Extras:
|